import request from '@/utils/request'

export function createArticlesApi(params) {
  return request({
    url: '/admin/articles',
    method: 'post',
    data: params
  })
}

export function getArticlesApi(params) {
  return request({
    url: '/admin/articles',
    method: 'get',
    params
  })
}

export function deleteArticlesApi(params) {
  return request({
    url: '/admin/articles',
    method: 'delete',
    data: params
  })
}

export function createDraftApi(params) {
  return request({
    url: '/admin/drafts',
    method: 'post',
    data: params
  })
}

export function updateDraftApi(params) {
  return request({
    url: '/admin/drafts',
    method: 'put',
    data: params
  })
}

export function deleteDraftApi(params) {
  return request({
    url: '/admin/drafts',
    method: 'delete',
    data: params
  })
}

export function getDraftListApi(params) {
  return request({
    url: '/admin/drafts/all',
    method: 'get',
    params
  })
}

export function getDraftInfoApi(params) {
  return request({
    url: '/admin/drafts',
    method: 'get',
    params
  })
}
